<?php

class Cms_Decorator_FormElementsLabel extends Zend_Form_Decorator_Abstract

      {

     /**
     * Default placement: prepend
     * @var string
     */
    protected $_placement = 'PREPEND';

  public function render($content)
    {
         $element = $this->getElement();

         $label = $element->getLabel();

         $description = $element->getDescription();

         $placement = $this->getPlacement();

         $translator = $element->getTranslator();

         if ($translator) { $label = $translator->translate($label); }
         
         $buildLabel = '<td>';
         $buildLabel .= ($element->isRequired()) ? '<span class="required">*</span>':'';
         $buildLabel .=  $label.":";
         $buildLabel .= ($description) ? "<br /><span class=\"help\">$description</span>":'';
         $buildLabel .= '</td>';

         $output = $buildLabel;

        switch($placement)
        {
            case 'PREPEND':
                return $output . $content;
                break;
            case 'APPEND':
                return $content . $output;
                break;
            default:
                return $output . $content;
                break;
        }
    }
}